﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CharmL {
    public class TestCLICL {
        public static void Test() {

            MaximalTest maxtest = new MaximalTest();
            maxtest.lattice = new List<LatticeNode>();
            CLICL clicl = new CLICL();

            //using (StreamWriter file = new System.IO.StreamWriter("Results.txt")) {
            using (StreamReader sr = new StreamReader("chess.txt")) {
                string line = string.Empty;

                int index = 1;
                DateTime start = DateTime.Now;
                line = sr.ReadLine();
                while (!string.IsNullOrEmpty(line)) {
                    char[] delimiters = new char[] { ' ' };
                    string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
                    List<int> itemSet = new List<int>();
                    foreach (var item in parts) {
                        itemSet.Add(int.Parse(item));

                        //if (!DCB.FreqIdx.Contains(value)) {
                        //    continue;
                        //}
                    }
                    if (itemSet.Count == 0) {
                        // Console.WriteLine("Skip!!");
                        continue;
                    }
                    itemSet.Sort();

                    LatticeNode temp = clicl.AddTransaction(1, itemSet, maxtest);
                    //if (maxtest.lattice.Contains(temp)) {
                    //    Console.WriteLine("existed");
                    //} else {
                    //    Console.WriteLine("not existed");
                    //}
                    index++;
                    Console.Write(index + " ");
                    line = sr.ReadLine();
                }

            }
        }
    }
}
